<template>
	<view class="content">
		<!-- <view :style="{ height: iStatusBarHeight + 'px', background: '#4596FF'}"></view> -->
		<image class="topnavbg" src="/static/itop1.png" mode="widthFix"></image>
		<view class="topSearchBox" :style="{top:titletop + 'px',height:titleheight + 'px'}">
			<image class="logo" src="/static/logo.png" mode="widthFix"></image>
			<view class="searchbox" :style="{lineHeight:titleheight + 'px' + 'px',height:titleheight + 'px'}"
				@click="tolist()">
				<image :style="{lineHeight:titleheight + 'px' + 'px',height:titleheight + 'px'}"
					src="../../static/sou.png" mode="widthFix"></image>
				<input @input="seachtext" />
			</view>
		</view>
		<view class="tabBox">
			<navigator url="/pages/index/list?cate_id=1" hover-class="none">
				<image class="tab" src="../../static/tab1.png" mode="widthFix"></image>
			</navigator>
			<navigator url="/pages/index/list?cate_id=2" hover-class="none">
				<image class="tab" src="../../static/tab2.png" mode="widthFix"></image>
			</navigator>
		</view>
		<view class="icptext">上海市浦东新区东方调解中心制</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				iStatusBarHeight: 0,
				titletop: '',
				titleheight: '',
			}
		},
		created() {
			this.getHeight()
		},
		onLoad() {
			this.iStatusBarHeight = uni.getSystemInfoSync().statusBarHeight;
		},
		methods: {
			tolist() {
				uni.navigateTo({
					url: '/pages/index/list'
				})
			},
			getHeight() {
				let res = uni.getMenuButtonBoundingClientRect();
				this.titletop = res.top;
				this.titleheight = res.height
				console.log(res);
				console.log("titletop的值", this.titletop);
				console.log("titleheight的值", this.titleheight);
				console.log("一半的titleheight的值", this.titleheight / 2);
			}
		}
	}
</script>

<style lang="scss">
	.status_bar {
		height: var(--status-bar-height);
		width: 750rpx;
		background: #66A8FF;
	}

	.icptext {
		width: 750rpx;
		text-align: center;
		color: #666;
		font-size: 26rpx;
		// position: fixed;
		// bottom: 20rpx;
		// left: 0;
	}

	.topnavbg {
		width: 750rpx;
		position: relative;
		top: 0;
		left: 0;
		z-index: -1;
	}

	.topSearchBox {
		width: 510rpx;
		// background: #66A8FF;
		overflow: hidden;
		padding: 0 20rpx;
		// margin-top: 12rpx;
		display: flex;
		align-items: center;
		position: absolute;

		.logo {
			width: 160rpx;
			float: left;
		}

		.searchbox {
			float: left;
			box-sizing: border-box;
			border: 1px solid #fff;
			border-radius: 60rpx;
			// line-height: 70rpx;
			// height: 70rpx;
			overflow: hidden;
			background: rgba(255, 255, 255, 0.2);
			display: flex;
			align-items: center;

			image {
				width: 40rpx;
				margin: 0 20rpx;
			}

			input {
				// line-height: 70rpx;
				// height: 70rpx;
				color: #fff;
			}
		}
	}

	.tabBox {
		width: 750rpx;
		overflow: hidden;
		display: flex;
		justify-content: center;
		margin-top: 20rpx;

		.tab {
			width: 350rpx;
			float: left;
		}
	}
</style>